package com.bbz.core.lambda.java8.Chapter_8_Refactoring;

import java.util.function.Consumer;
import java.util.function.Predicate;

class OnlineBankingLambda {
    /**
     * lambda 方式
     */
    public void processCustomer(int id, Consumer<String> makeCustomerHappy) {
        String userName = id + "bbz";
        makeCustomerHappy.accept(userName);
    }
    /**
     * lambda 方式
     */
    public void processPredicate(String userName, Predicate<String> predicate, Consumer<String> consumer) {
        if (predicate.test(userName)) {
            consumer.accept(userName);
        }
    }
}
